{% extends "blog/nako/base.html" %}

{% block title %}
标签: {{ tag_name | safe }} - {{ super() }}
{% endblock title %}
{% block description %}{{ tag_data.desc | safe }}{% endblock description %}

{% block breadcrumb %}
标签: <a href="#">{{ tag_name | safe }}</a>
{% endblock breadcrumb %}

{% block content %}
<div class="row">
  <div class="col-md-8 blog-main blog-list">
      <div class="row">
        {% if arts %}
            {% for art in arts %}
            <div class="col-12 blog-item">
                <article class="blog-teaser">
                    <header>
                        <div class="blog-cover">
                            <img src="{{ art.cover }}" alt="{{ art.title }}">
                        </div>
                        <div class="blog-title">
                            <h3><a href="{{ url_for(name='blog.view-index', elements=[art.uuid | as_str]) | safe }}">{{ art.title }}</a></h3>
                            <span class="meta">{{ art.add_time | date(format="%Y-%m-%d", timezone="Asia/Shanghai") }}, {{ art.from | default(value='网络') }}</span>
                        </div>
                    </header>
                    <div class="body">{{ art.brief }}</div>
                    <div class="clearfix">
                        <a href="{{ url_for(name='blog.view-index', elements=[art.uuid | as_str]) | safe }}" class="btn btn-clean-one">阅读更多</a>
                    </div>
                </article>
            </div>
            {% endfor %}
        {% endif %}
      </div>

      {% if num_pages > 1 %} 
      <div class="paging">
        {% if page == 1 %} 
            <span class="older">上一页</span>
        {% else %}
            <a href="/?page={{ page - 1 }}" class="older">上一页</a>
        {% endif %} 

        <span class="now-page">{{ page | default(value="1") }}</span>
        
        {% if page == num_pages %} 
            <span class="newer">下一页</span>
        {% else %}
            <a href="/?page={{ page + 1 }}" class="newer">下一页</a>
        {% endif %}
      </div>
      {% endif %} 
  </div>

  <aside class="col-md-4 blog-aside">
    {% include "blog/nako/_right.html" %}
  </aside>

</div>
{% endblock content %}